package o;

import android.app.AlertDialog;
import android.content.Context;
import com.huawei.appgallery.foundation.ui.framework.widget.dialog.dialogactivity.DialogActivity;
import o.brc.e;
import o.bww.h;
import o.bxa.d;
import o.ckh.a;

public class bxr {
    public fjo<Boolean> ˊ(Context context, long j, String str) {
        final fjx o_fjx = new fjx();
        if (doo.ˊ(bqy.ˋ().ˏ())) {
            final Context context2 = context;
            final long j2 = j;
            final String str2 = str;
            ((cbh) fho.ˏ().ˋ("User").ॱ(cbh.class)).ˎ(context, 1).ˋ(fjt.ˋ(), new fjq<Boolean>(this) {
                final /* synthetic */ bxr ˎ;

                public void onComplete(fjo<Boolean> o_fjo_java_lang_Boolean) {
                    if (o_fjo_java_lang_Boolean.ˊ() && ((Boolean) o_fjo_java_lang_Boolean.ॱ()).booleanValue()) {
                        this.ˎ.ॱ(context2, j2, o_fjx, str2);
                    }
                }
            });
            return o_fjx.ॱ();
        }
        evk.ˏ(context, h.ʽॱ, 0).ˋ();
        o_fjx.ॱ(Boolean.valueOf(false));
        return o_fjx.ॱ();
    }

    private void ॱ(Context context, long j, fjx<Boolean> o_fjx_java_lang_Boolean, String str) {
        byb o_byb = new byb(context, h.ʼ);
        final Context context2 = context;
        final long j2 = j;
        final fjx<Boolean> o_fjx_java_lang_Boolean2 = o_fjx_java_lang_Boolean;
        final String str2 = str;
        o_byb.ˏ(new a(this) {
            final /* synthetic */ bxr ˏ;

            public void ˏ(AlertDialog alertDialog, DialogActivity.a aVar, int i) {
                if (-1 == i) {
                    this.ˏ.ˏ(context2, j2, o_fjx_java_lang_Boolean2, str2);
                }
            }
        });
        o_byb.ॱ();
    }

    private void ˏ(final Context context, long j, final fjx<Boolean> o_fjx_java_lang_Boolean, String str) {
        ((brc) fho.ˏ().ˋ("Base").ॱ(brc.class)).ˋ(new d(j).ˎ("").ˏ(bsv.ॱ(str)).ˎ(), new e<bxa, bxe>(this) {
            final /* synthetic */ bxr ॱ;

            public /* synthetic */ void ˋ(Object obj, Object obj2) {
                ˊ((bxa) obj, (bxe) obj2);
            }

            public /* synthetic */ void ˏ(Object obj, Object obj2) {
                ˎ((bxa) obj, (bxe) obj2);
            }

            public void ˎ(bxa o_bxa, bxe o_bxe) {
            }

            public void ˊ(bxa o_bxa, bxe o_bxe) {
                if (o_bxe == null) {
                    evk.ˏ(context.getString(h.ˊ));
                    o_fjx_java_lang_Boolean.ॱ(Boolean.valueOf(false));
                    return;
                }
                boolean z;
                if (o_bxe.getResponseCode() == 0 && o_bxe.getRtnCode_() == 0) {
                    z = true;
                } else {
                    z = false;
                }
                if (z) {
                    evk.ˏ(context.getString(h.ˏ));
                    o_fjx_java_lang_Boolean.ॱ(Boolean.valueOf(true));
                    return;
                }
                evk.ˏ(context.getString(bse.ˏ.ॱ(o_bxe.getRtnCode_()).ˏ()));
                o_fjx_java_lang_Boolean.ॱ(Boolean.valueOf(false));
            }
        });
    }
}
